package eu.sudparis.it.opp.graph;

public class Edge {
	public int nda, ndb;
	public double weight=1.0;

	public Edge(int id1,int id2){
		int nnda=id1;
		int nndb=id2;
		if(nnda>nndb){
			int temp=nnda;
			nnda=nndb;
			nndb=temp;
		}
		this.nda=nnda;
		this.ndb=nndb;
	}
	
	public boolean equals(Object obj){
		int temp=nda;
		if(nda>ndb){
			nda=ndb;
			ndb=temp;
		}
		Edge edge=(Edge)obj;
		temp=edge.nda;
		if(edge.nda>edge.ndb){
			edge.nda=edge.ndb;
			edge.ndb=temp;
		}
		return nda==edge.nda&&ndb==edge.ndb;
	}
	public String toString(){
		return "N"+nda+"N"+ndb;
	}
}
